package day8;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileReaderTest1 {
    public static void main(String[] args) {
        try {
            FileReader r=new FileReader("D:\\Documents\\桌面\\rent-freely-master\\free-room\\README.txt");
//  1:
// int ch=0;
//            while ((ch=r.read())!=-1){
//                System.out.print((char)ch);
//                //System.out.print(ch+" "+(char)ch);
//            }
            //2:
            char c[]=new char[100];
            int len=0;
            while ((len=r.read(c))!=-1){
                System.out.print(new String(c,0,len));
            }
            r.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
